from __future__ import division
import os

inputFileName = "/data1/team/obukai/machine-learning-project-related/auxFiles/threadPathMappingTableForGov2"
inputFileHandler = open(inputFileName,"r")

gov2DatasetBasePath = "/data/jhe/trecdata/"

outputFileBasePath = "/data1/team/obukai/machine-learning-project-related/auxFiles/gov2DataPaths/"

for line in inputFileHandler.readlines():
    outputRelativeFileName = line.strip()
    outputDefinteFileName = outputFileBasePath + outputRelativeFileName
    outputFileHandler = open(outputDefinteFileName,"w")
    
    for dirname, dirnames, filenames in os.walk(gov2DatasetBasePath + outputRelativeFileName):
        
        filenames.sort()
        #for subdirname in dirnames:
        #    print os.path.join(dirname, subdirname)
        for filename in filenames:
            if filename.endswith(".gz"):
                #print filename
                outputLine = os.path.join(dirname, filename)
                print outputLine
                outputFileHandler.write(outputLine + "\n")

    print 
    outputFileHandler.close()

print "END."


        




